Skip to content

Conversation

@celskeggs
Copy link
Contributor

Rather than always giving up as soon as Vosk indicates a single period of silence, allow the user to configure Dicio to accept up to seven consecutive periods of silence before it gives up.

I've been test driving a checklist skill that reads a list of steps and waits for me to confirm each one, and sometimes I'm not ready to respond immediately to Dicio. By extending the length of time that Vosk listens for speech, I'm able to make this skill more useful. The same option may be useful for other more "interactive" skills, so I'm contributing it as a separate PR before I'm ready to contribute back the checklist skill itself.

Rather than always giving up as soon as Vosk indicates a single period
of silence, allow the user to configure Dicio to accept up to seven
consecutive periods of silence before it gives up.
Copy link
Owner

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very useful addition, thank you! I made some comments but I like the overall structure

@Composable
fun sttSilenceDuration() = IntSetting(
title = stringResource(R.string.pref_stt_silence_duration_title),
icon = Icons.AutoMirrored.Filled.Send,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use a different icon here, like hourglass_empty

UNRECOGNIZED,
INPUT_DEVICE_UNSET,
INPUT_DEVICE_VOSK -> VoskInputDevice(appContext, okHttpClient, localeManager)
INPUT_DEVICE_VOSK -> VoskInputDevice(appContext, okHttpClient, localeManager, settings)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user changes the settings after this has been built, the old settings instance will remain. It's probably better to maintain the previous code for the rest of the class and instead pass dataStore here.

) {
_state.value = Listening(speechService, eventListener)
speechService.startListening(VoskListener(this, eventListener, speechService))
speechService.startListening(VoskListener(this, eventListener, settings.sttSilenceDuration, speechService))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to set settings.sttSilenceDuration to something like 2 by default (i.e. when the setting has never been changed by the user yet)?

Copy link
Owner

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops I should have pressed "Request changes"

@Stypox
Copy link
Owner

Stypox commented Oct 2, 2025

@celskeggs sorry for the ping, have you had time to look into my review? No worries if you don't have time, just let me know :-)

@celskeggs
Copy link
Contributor Author

@Stypox Thanks for your patience! I forgot I had this pull request outstanding, though I haven't really had time to look at this regardless. If you or someone else wants to take over this PR, please feel free, and otherwise I will come back to this when life allows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants